//
//  GLBadgeViewController.h
//  GLFormKitDemo
//
//  Created by 121 on 2018/3/28.
//  Copyright © 2018年 杭州吉利控股信息中心. All rights reserved.
//

#import "GLFormDateHeader.h"
#import <Masonry/Masonry.h>
@interface GLFormDateHeader()

@end

@implementation GLFormDateHeader

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self UIInit];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

-(void)UIInit{
    [self.contentView addSubview:self.titleLab];
    [self.contentView addSubview:self.topDateLab];
    [self.contentView addSubview:self.bottomDateLab];
    
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(self.edgeMargin);
        make.left.equalTo(self.contentView).offset(self.edgeMargin);
        make.bottom.equalTo(self.contentView).offset(-self.edgeMargin);
    }];
    [self.topDateLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(self.contentMargin);
        make.left.equalTo(self.titleLab.mas_left).offset(self.contentMargin);
        make.right.equalTo(self.contentView).offset(-self.edgeMargin);
    }];
    [self.bottomDateLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(self.topDateLab);
        make.top.equalTo(self.topDateLab.mas_bottom).offset(self.contentMargin);
        make.bottom.equalTo(self.contentView).offset(-self.contentMargin);
    }];
}
/*
 * need override
 */

-(void)setRowValue:(id)value{
    [super setRowValue:value];
    
}
/*
 *need call
 */
//-(void)valueDidChanged:(id)newValue;
//-(void)clicked:(id)sender subTag:(NSString*)tag;


#pragma mark- setter and getter
-(UILabel*)titleLab{
    if (!_titleLab) {
        _titleLab = [[UILabel alloc]init];
        _titleLab.backgroundColor = [UIColor clearColor];
        _titleLab.textAlignment = NSTextAlignmentLeft;
        _titleLab.textColor = [UIColor blackColor];
        _titleLab.font = [UIFont systemFontOfSize:16];
        _titleLab.text = @"title";
    }
    return _titleLab;
}
-(UILabel*)topDateLab{
    if (!_topDateLab) {
        _topDateLab = [[UILabel alloc]init];
        _topDateLab.backgroundColor = [UIColor clearColor];
        _topDateLab.textAlignment = NSTextAlignmentRight;
        _topDateLab.textColor = [UIColor grayColor];
        _topDateLab.font = [UIFont systemFontOfSize:12];
        _topDateLab.text = @"date";
    }
    return _topDateLab;
}

-(UILabel*)bottomDateLab{
    if (!_bottomDateLab) {
        _bottomDateLab = [[UILabel alloc]init];
        _bottomDateLab.backgroundColor = [UIColor clearColor];
        _bottomDateLab.textAlignment = NSTextAlignmentRight;
        _bottomDateLab.textColor = [UIColor grayColor];
        _bottomDateLab.font = [UIFont systemFontOfSize:12];
        _bottomDateLab.text = @"date";
    }
    return _bottomDateLab;
}
@end
